package o;

import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.Layout;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.ArrayList;
import java.util.List;

public class eak extends eei {
    private e ॱ;

    public interface e {
        void ˋ();

        void ॱ(int i);
    }

    public eak(e eVar) {
        this.ॱ = eVar;
    }

    protected void ˏ(cia o_cia, List<Layout> list, String str) {
        if (CollectCheck.isEmpty(list) || o_cia == null) {
            Logger.ˋ("InfoFlowProviderCreator", "analyseLayouts, provider = " + o_cia);
            return;
        }
        Logger.ˎ("InfoFlowProviderCreator", "analyseLayouts, already hava layout size = " + o_cia.ॱˊ() + ", receive new layout size: " + list.size());
        ˊ(o_cia, list);
        List arrayList = new ArrayList();
        for (Layout layout : list) {
            String ˎ = layout.ˎ();
            if (layout.ॱ() == -1) {
                Logger.ˋ("InfoFlowProviderCreator", "analyseLayouts, unsupport card: " + ˎ);
            } else {
                chz ˋ = ˋ(o_cia, layout, str);
                if (ˋ != null) {
                    ˋ.ˋ(o_cia.csSheet, layout.ˏ());
                    arrayList.add(ˋ);
                } else {
                    Logger.ˋ("InfoFlowProviderCreator", "analyseLayouts, cardChunk == null");
                }
            }
        }
        if (!arrayList.isEmpty()) {
            o_cia.ˎ(arrayList, 0);
        }
        ˏ(o_cia, list);
    }

    protected void ˊ(cia o_cia, List<Layout> list) {
        if (!(o_cia instanceof eae)) {
            Logger.e("InfoFlowProviderCreator", "onAnalyseLayoutsStart, provider not instanceof InfoFlowDataProvider = " + o_cia);
        } else if (!list.isEmpty()) {
            eae o_eae = (eae) o_cia;
            if (o_eae.ˏॱ()) {
                o_eae.ᐝॱ();
            }
            if (o_eae.ˏ()) {
                o_eae.ˊ();
            }
        }
    }

    protected void ˏ(cia o_cia, List<Layout> list) {
    }

    protected void ˋ(cia o_cia, chz o_chz, List<CardBean> list) {
        if (o_cia instanceof eae) {
            ((eae) o_cia).ˊ(o_chz, list);
        }
    }

    protected void ˊ(cia o_cia, chd o_chd, BaseDetailResponse baseDetailResponse, int i) {
        if (o_cia instanceof eae) {
            int ˏ = o_chd.ˏ();
            eae o_eae = (eae) o_cia;
            o_eae.ˎ();
            o_eae.ॱˎ();
            if (this.ॱ == null) {
                return;
            }
            if (i <= 0) {
                this.ॱ.ˋ();
                return;
            } else if (ˏ > 1 || o_eae.ˋ()) {
                this.ॱ.ॱ(i);
                return;
            } else if (Logger.ˎ()) {
                Logger.ˏ("InfoFlowProviderCreator", "onAnalyseLayoutDatasEnd, reqNum = " + ˏ);
                return;
            } else {
                return;
            }
        }
        if (this.ॱ != null) {
            this.ॱ.ˋ();
        }
        Logger.e("InfoFlowProviderCreator", "onAnalyseLayoutDatasEnd, provider not instanceof InfoFlowDataProvider = " + o_cia);
    }

    protected chz ˋ(cia o_cia, Layout layout, String str) {
        return o_cia.ˎ(layout.ˋ(), layout.ॱ(), layout.ˊ(), null, str);
    }
}
